#include "Vector2D.h"


float Magnitude(const Vector2D& vec)
{
    return sqrt(vec.x * vec.x + vec.y * vec.y);
}


Vector2D operator*(float val, const Vector2D& vec)
{
    return Vector2D(val * vec.x, val * vec.y);
}


float Distance(const Vector2D& vec1, const Vector2D& vec2)
{
    float dx = vec1.x - vec2.x;
    float dy = vec1.y - vec2.y;

    return sqrt(dx * dx + dy * dy);
}
